function TeacherService() {

    //获取列表
    this.getList = function getList(taskId, callback) {
        var data = {};
        data.taskId = taskId;
        var ret = null;
        jQuery.ajax({
            url: "/m/teacher/list/json",
            data: data,
            success: function (res) {
                if (res != "") {
                    var list = JSON.parse(res);
                    ret = list;
                }
            },
            complete: function () {
                if (callback) {
                    callback(ret);
                }
            }
        });
    }

    /**
     * 更新名称
     * @param taskId
     * @param id
     * @param name
     * @param callback
     */
    this.updateName = function updateName(taskId, id, name, callback) {
        var data = {};
        data.taskId = taskId;
        data.id = id;
        data.name = name;

        var ret = null;
        jQuery.ajax({
            type:"POST",
            url: "/m/teacher/name",
            data: data,
            success: function (res) {
                ret = res;
            },
            error:function () {
                ret = 0;
            },
            complete: function () {
                if (callback) {
                    callback(ret);
                }
            }
        });
    }
}